{% extends "base.html" %}   

{% block content %}   
    {% if selected_category %}
    <p>Current category : {{ selected_category.name }}</p>
    {% endif %}

    {% for art in articles %}
    <div>
        <h2><a href="/blog/{{art.id}}/">{{ art.title }}</a></h2>
        <i>PostTime:{{ art.post_time }}</i>&nbsp;&nbsp;<i>Category:<a href="/blog/cate/{{ art.category.id }}/">{{ art.category.name }}</a></i>&nbsp;&nbsp;Views:{{ art.view_count }}&nbsp;&nbsp;Comments:{{ art.comm_count }}
        {% ifequal art.summary art.content %}        
        <p>{{ art.content }}</p>
        {% else %}
        <p>{{ art.summary }}</p>
        <p><a href="/blog/{{art.id}}/">More>></a></p>
        {% endifequal %}
    </div>
    {% endfor %}    
    
    {% if is_paginated %}
        {% if has_previous %} 
        <a href="?page={{ previous_page }}">Previous</a>
        {% endif %}
        {% if has_next %}
        <a href="?page={{ next_page }}">Next</a>
        {% endif %}
    {% endif %}              
{% endblock %}